@extends('admin._layouts.default')

@section('main')

      <div class="row-fluid ">
        <div class="span12 box gradient ">
      <div class="title">
            <div class="row-fluid">
                <h3>
                  <div class="pull-right span8 mg5" action="#">
                  <div class="pull-right input-append row-fluid">

                  </div>
                  </div>

                  <i class="fa fa-credit-card"></i> 积分记录
                </h3>
            </div>
        </div><!-- End .title -->
        <div class="content min_h500">
            <table id="datatable_in" class="responsive table table-striped" style="width:100%;margin-bottom:0; ">
              <thead>
               <tr>
                 <th width="80">
                   积分数量
                  </th>
                  <th width="80">
                    变化
                  </th>
                  <th width="80">
                    操作
                  </th>
                  <th width="120">
                   操作员
                  </th>
                  <th width="120">
                   记录日期
                  </th>
               </tr>
              </thead>
              <tbody>
              @foreach($pointrecords as $pointrecord)
               <tr>
                 <td>
                    {{ $pointrecord->count }}
                  </td>
                  <td>
                     <span>@if($pointrecord->add == 1) + @else - @endif</span>
                 </td>
                 <td>
                 @if($pointrecord->action == 1)
                    <strong class="color_green"> 转发浏览文章</strong><br/>
                    @elseif($pointrecord->action == 2)
                    <strong class="color_info"> 完善信息</strong><br/>
                    @elseif($pointrecord->action == 3)
                    <strong class="color_blue"> 试用完成机器</strong><br/>
                    @elseif($pointrecord->action == 4)
                    <strong class="color_orange"> 完成评价</strong><br/>
                    @elseif($pointrecord->action == 5)
                    <strong class="color_orange"> 成功邀请{{ $pointrecord->inviteid->name }}试用机器</strong><br/>
                    @elseif($pointrecord->action == 6)
                    <strong class="color_orange"> 订购完成机器</strong><br/>
                    @elseif($pointrecord->action == 7)
                    <strong class="color_orange"> 成功邀请{{ $pointrecord->inviteid->name }}订购机器</strong><br/>
                    @elseif($pointrecord->action == 'supplement')
                    <strong class="color_info"> 完善信息</strong><br/>
                    @elseif($pointrecord->action == 'attempt_finish')
                    <strong class="color_blue"> 试用完成机器</strong><br/>
                    @elseif($pointrecord->action == 'rate')
                    <strong class="color_orange"> 完成评价</strong><br/>
                    @elseif($pointrecord->action == 'inviter_attempt_finish')
                    <strong class="color_orange"> 成功邀请{{ $pointrecord->inviteid->name }}试用机器</strong><br/>
                    @elseif($pointrecord->action == 'inviter_attempt')
                    <strong class="color_orange"> 成功邀请{{ $pointrecord->inviteid->name }}申请试用机器</strong><br/>
                    @elseif($pointrecord->action == 'inviter_reg')
                    <strong class="color_orange"> 成功邀请{{ $pointrecord->inviteid->name }}注册</strong><br/>
                    @elseif($pointrecord->action == 'pay_finish')
                    <strong class="color_orange"> 订购完成机器</strong><br/>
                    @elseif($pointrecord->action == 'inviter_click')
                    <strong class="color_orange"> 转发装机秀</strong><br/>
                    @elseif($pointrecord->action == 'inviter_pay_finish')
                    <strong class="color_orange"> 成功邀请{{ $pointrecord->inviteid->name }}订购机器</strong><br/>
                    @elseif($pointrecord->action == 'attempt')
                    <strong class="color_orange"> 申请试用</strong><br/>
                    @else
                    <strong class="color_gray"> {{ $pointrecord->action }}</strong><br/>
                    @endif
                 </td>
                 <td>
                    {{ $pointrecord->user->username }}
                 </td>
                 <td>
                    {{ $pointrecord->created_at }}
                 </td>
               </tr>
               @endforeach



               </tbody>
            </table>
                <div class="row-fluid control-group">
                 <div class="span6">
                    <div class="pagination pull-right ">
                    {{ $pointrecords->appends(array('id' => $id))->links() }}
                    </div>
                  </div>
                </div>
                <br/>
               <!-- End row-fluid -->





        </div> <!-- End .content -->


        </div>
        <!-- End box -->
      </div>


@stop



@section('modals')
<div id="work_out" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 class="modal-title" id="myModalLabel">装机列表</h3>
      </div>
      <div class="modal-body">
          {{--<div class="form-row control-group row-fluid">--}}
            {{--<div class="controls span9">--}}
              {{--<div class="input-append row-fluid">--}}
                {{--<input type="text" class="span5" id="search-input" placeholder="搜索员工">--}}
                {{--<button type="submit" class="btn">搜索</button>--}}
              {{--</div>--}}
            {{--</div>--}}
          {{--</div>--}}

            {{ Form::open(array('route' => 'admin.services.paidan','id'=>'works','class'=>'form-horizontal')) }}
          <input type="hidden" name="service_id" value="" id="service_id">
          <table class="table" id="mount_info">
            <tr>
                <td>装机人</td>
                <td>装机电话</td>
                <td>装机型号</td>
                <td>装机日期</td>
                <td>状态</td>
            </tr>
          </table>
        {{ Form::close() }}

      </div>
      <div class="modal-footer">
                <div class="row-fluid control-group">
                  <div class="pull-left span6" action="#">
                    <div class="pagination pull-left ">
                    </div>
                  </div>
                  <div class="span6">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                  </div>
                </div>


      </div>
    </div>
  </div>
</div>

<div id="confirm_alert" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 class="modal-title" id="myModalLabel">确定本次操作吗？</h3>
      </div>
      <div class="modal-body">
        <i class=" icon-warning-sign color_red pull-left fs_24"></i>

        <p>一旦【确定】，本次操作不可撤销。</p>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" id="" class="btn btn-primary">确定</button>
      </div>
    </div>
  </div>
</div>
@stop

@section('script')
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.peity.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.uniform.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/chosen/chosen/chosen.jquery.min.js') }}"></script>

<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/flot/jquery.flot.js') }}"></script>



<script src="{{ URL::asset('web/js/scripts.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/jnavigate.jquery.min.js') }}"></script>
<script>
function mount_show(id){
        var img = '<img src="{{ URL::asset('ad/img/ajax-loader.gif') }}">';
        $('#mount_info').html(img);

        $.post('{{ URL::route('admin.customers.mount_info') }}',{id : id},function(data){
            $('#mount_info').html(data);
        });
}
</script>
@stop
